package day06;

import java.util.Arrays;
import java.util.Scanner;

public class MethodDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
//        int ac = scanner.nextInt();
//        int ad = scanner.nextInt();
//        say();
//        say(ac);
//        say(ac,ad);
//        if (ad == num()){
//            System.out.println("滚");
//        }
//       long a = jie(ac);
//        int s = num(ad,ac);
//        System.out.println(s+"\t"+a);
        a();
        int[] x = arr(20,1000);
        System.out.println(Arrays.toString(x));

        int[] e = arr(5,100);
        for (int i = 0;i < e.length;i++){
            System.out.println(e[i]);
        }
        String name = scanner.nextLine();
        int age = scanner.nextInt();
        sayHello(name,age);
    }

    //有返回值
    public static int num(){
        return 1;
    }

    public static int num(int n1,int n2){
        int sum = n1+n2;
        return sum;
    }

    static long jie(int a){
        if (a == 1){
            return 1;
        }else {
            return a*jie(a-1);
        }
    }
    public static void a(){
        int[] arr = new int[10];
        for (int i = 0;i < 10;i++){
            arr[i] = (int) (Math.random()*100);
        }
        System.out.println(Arrays.toString(arr));
    }
    public static int[] arr(int len,int max){
        int[] arr = new int[len];
        for (int i = 0;i < arr.length;i++){
            arr[i] = (int) (Math.random()*(max+1));
        }
       return arr;
    }
    public static void sayHello(String name,int age){
        if (age>60){
            return;
        }
        System.out.println("大家好，我叫"+name+",今年"+age+"岁");
    }






    //无返回值
    public static void say(){
        System.out.println("------------");
    }
    public static void say(String name){
        System.out.println("我是"+name+",是兄弟来砍我");
    }
    public static void say(String a,int b){
        System.out.println("大家好，我叫"+a+"，今年"+b+"岁");
    }
}
